<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // 普通字符串
        let str1 = 'hello world';
        let str2 = "hello world";

        // 模板字符串
        let str3 = `hello world`;

        // 模板字符串的好处

        // 1. 可以换行
        let str4 = `
            hello
            world
        `;
        console.log(str4);

        // 2. 可以插入变量
        let name = '张三';
        let age = 18;
        let str5 = `我叫${name}，今年${age}岁`;
        console.log(str5);

        // 3. 可以插入表达式
        let a = 1;
        let b = 2;
        let str6 = `a + b = ${a + b}`;
        console.log(str6);

        

    </script>
</body>
</html>